#ifndef __ROADMAP_H
#define __ROADMAP_H

#include "vector.h"
#include "object.h"
#include "terrain.h"
#include "entity.h"

typedef struct{
    float x;
    float z;
} checkp;
    

class RoadMap: public CEntity{
    private:
		CTerrain *terrain;
		int ncheckps;
        checkp checkpoints[894];
        int heading;
		CEntity * bola;
        int owner;
		
    public:
	    int  checkpidx;
		RoadMap(){
		    setCheckp();
    		checkpidx = 0;
		    bola = NULL;
		};
		
	    RoadMap(CTerrain *t, int owner);
		~RoadMap(){};
		
		void setCheckp();                       // situa las posiciones de los checkpoints
		int nCheckpoints(){return ncheckps;}    // devuelve la cantidad de checkpoints que hay
        checkp nextCheckp(bool mostrar=false);  // devuelve la posicion del siguiente checkpoint
        CVector checkpPosition();
        
        float distance(CVector a, CVector b);
};

#endif
